package trade;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import org.springframework.cloud.netflix.hystrix.EnableHystrix;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
import trade.bean.TCashierTrade;
import trade.service.ITCashierTradeService;

@SpringBootApplication
@EnableDiscoveryClient
public class TradesysApplication {

	public static void main(String[] args) {
		SpringApplication.run(TradesysApplication.class, args);
		System.out.println("-------------------------------------");
		System.out.println("|									|");
		System.out.println("|	TradeSys系统已完成启动端口为8104	|");
		System.out.println("|									|");
		System.out.println("-------------------------------------");
	}

	//应用类中注入相关使用工具，如RestTemplate和PageHelper
	//使用负载均衡才能使用spring application name访问
	@Bean
	@LoadBalanced
	RestTemplate restTemplate() {
		return new RestTemplate();
	}
}
